package com.lyouu.dataminer.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.lyouu.dataminer.db.DbConstants;
import com.lyouu.dataminer.factory.MysqlDbFactory;

public class MdAlbumDao {
	public int insert(int albumId, int sid, String name, String imgUrl)
			throws SQLException {
		Connection conn =  MysqlDbFactory.getConnection(DbConstants.DB_LYOUU);
		String sql = "INSERT INTO md_album (albumid,city_id,sid,name,thumb,des,lastupdate,num) VALUES (?,'1',?,?,?,'',?,'1')";
		PreparedStatement stmt = conn.prepareStatement(sql);
		stmt.setInt(1, albumId);
		stmt.setInt(2, sid);
		stmt.setString(3, name);
		stmt.setString(4, imgUrl);
		stmt.setInt(5, (int) (System.currentTimeMillis() / 1000));
		return stmt.executeUpdate();
	}
}
